<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8">
		<title>商品类别添加</title>
	</head>
	<body>
		<center>
			<?php 
				//定义传递过的参数的值
				$pid = 0;
				$path = '0,';
				$name = "根类别";
				//判断有没有传过来的值，若有，则替换定义的值
				if(isset($_GET['pid']) && isset($_GET['path'])){
					$pid = $_GET['pid'];
					$path = $_GET['path'].$pid.",";		//设置路径
					$name = $_GET['name'];
				}
			 ?>
			<h3>商品类别添加</h3>
			<form action="action.php?a=insert" method="post">
				父别名：<?php echo $name; ?><br><br>
				类别名：<input type="text" name="name"><br><br>
				<input type="hidden" name="pid" value="<?php echo $pid; ?>">
				<input type="hidden" name="path" value="<?php echo $path; ?>">
				<input type="submit" value="提交">
				<input type="reset" value="重置">
			</form>
		</center>
	</body>
</html>